package com.endpoint.memory.configuration;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.endpoint.memory.MemCollector;
import com.endpoint.memory.MemStatus;
import com.endpoint.memory.MemoryEndpoint;

/**
 * Description:
 *
 * @author yuanma
 * @version 1.0
 * @date: 2018/7/20 15:09
 * @since JDK 1.8
 */
@Configuration
public class MemoryEndpointConfiguration {

	private volatile List<MemStatus> status = new ArrayList<>();

	@Bean
	public MemoryEndpoint memoryEndpoint() {
		return new MemoryEndpoint(status);
	}

	@Bean
	public MemCollector memCollector() {
		return new MemCollector(status);
	}

}
